package com.fh.shop.service.impl;/**
 * 描述:
 * Author:袁亚强
 * Date:2021/12/1617:32
 */

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fh.common.exceptions.ParamException;
import com.fh.shop.entity.po.Imgs;
import com.fh.shop.mapper.ImgsMapper;
import com.fh.shop.service.ImgsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * created by macro on 2021/12/16,
 */
@Service
public class ImgsServiceImpl implements ImgsService {
    @Autowired
    private ImgsMapper imgsMapper;


    @Override
    public List<Imgs> queryById(Integer id) {
        if (id == null) {
            throw new ParamException();
        }
        QueryWrapper<Imgs> imgsQueryWrapper = new QueryWrapper<>();
        imgsQueryWrapper.eq("pid", id);
        List<Imgs> imgs = imgsMapper.selectList(imgsQueryWrapper);
        return imgs;
    }
}
